﻿using System;

namespace Stauffware.Common.Core
{
	/// <summary>
	/// Options for parsing numbers.
	/// </summary>
	[Flags]
	public enum NumberParseOptions
	{
		/// <summary>
		/// No options.  Note that this implies (! ParseEntireInput).
		/// </summary>
		None = 0,

		#region ParseOptions compatibility

		/// <summary>
		/// Allow leading whitespace.  (Equal to ParseOptions.AllowLeadingWhite.)
		/// </summary>
		AllowLeadingWhite	= ParseOptions.AllowLeadingWhite,

		/// <summary>
		/// Allow trailing whitespace.  (Equal to ParseOptions.AllowTrailingWhite.)
		/// </summary>
		AllowTrailingWhite	= ParseOptions.AllowTrailingWhite,

		/// <summary>
		/// Allow inner whitespace (but never between digits, decimal point, or digit separator).
		/// (Equal to ParseOptions.AllowInnerWhite.)
		/// </summary>
		AllowInnerWhite		= ParseOptions.AllowInnerWhite,

		/// <summary>
		/// Equivalent to combining AllowLeadingWhite, AllowInnerWhite, and AllowTrailingWhite.
		/// (Equal to ParseOptions.AllowWhiteSpace.)
		/// </summary>
		AllowWhiteSpace		= ParseOptions.AllowWhiteSpace,

		/// <summary>
		/// Forces parsing of the entire input string.
		/// Without this option, extraneous characters following a valid number will
		/// terminate the parsing, but not cause an error.
		/// (Equal to ParseOptions.ParseEntireInput.)
		/// </summary>
		ParseEntireInput	= ParseOptions.ParseEntireInput,

		#endregion

		/// <summary>
		/// Allow a leading sign character.
		/// </summary>
		AllowLeadingSign	= 0x00100,

		/// <summary>
		/// Allow a trailing sign character.
		/// </summary>
		AllowTrailingSign	= 0x00200,

		/// <summary>
		/// Allow use of parentheses to indicate a negative number.
		/// </summary>
		AllowParentheses	= 0x00400,

		/// <summary>
		/// Allow a decimal point.  
		/// Whether digits to the right are allowed depends on the parser. 
		/// </summary>
		AllowDecimalPoint	= 0x00800,

		/// <summary>
		/// Allow digits to be separated into groups using, for example, a comma.
		/// </summary>
		AllowGrouping		= 0x01000,

		/// <summary>
		/// Allow an exponent.
		/// </summary>
		AllowExponent		= 0x02000,

		/// <summary>
		/// Composite of AllowLeadingSign, AllowTrailingSign,AllowParentheses
		/// </summary>
		AllowAnySign = AllowLeadingSign | AllowTrailingSign | AllowParentheses,

		// AllowHexSpecifier
	}
}
